<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include/head::commonHeader('变更课程信息')">

</head>
<body>
<div class="ch-container">
    <div class="row">
        <div id="content" class="col-md-12 col-sm-12" style="padding:2px;width: 99%;">
            <div class="row">
                <div class="box col-sm-12" style="margin-top:5px;" >
                    <form class="form-horizontal" th:action="@{'/lesson/change/init/'+${lessonId}}" method="post" th:onsubmit="'return checkForm();'">
                        <fieldset style="border-top: 1px solid rgb(229, 229, 229);-webkit-padding-start: 25px">
                            <legend style="text-align: left;font-size: 14px;border: 0;width: auto;margin-bottom: auto;"><span style="font-weight:bold;">原课程信息</span></legend>
                            <div class="form-group">
                                <div class="col-sm-1"> </div>
                                <div class="col-sm-4">
                                    <label class="control-label" style="margin-right: 10px;">上课老师:</label><span th:text="${lessonInfo.teacherLogin}" style="margin-right: 20px;"></span>
                                </div>
                                <div class="col-sm-4">
                                    <label class="control-label" style="margin-right: 10px;">上课时间:</label><span th:text="${#dates.format(lessonInfo.releaseTime,'yyyy/MM/dd H:m')}" style="margin-right: 20px;"></span>
                                </div>
                                <div class="col-sm-2">
                                    <label class="control-label" style="margin-right: 10px;">上课平台:</label><span th:text="${lessonInfo.classWayName}"></span>
                                </div>
                            </div>
                        </fieldset>
                        <fieldset style="border-top: 1px solid rgb(229, 229, 229);-webkit-padding-start: 25px">
                            <legend style="text-align: left;font-size: 14px;border: 0;width: auto;"><span style="font-weight:bold;">调整后的课程信息</span></legend>
                            <div class="form-group">
                                <label class="control-label col-sm-2">筛选老师:</label>
                                <div class="col-sm-10  form-inline">
                                    <select id="teaSiteId" name="teaSiteId" class="form-control" th:onchange="|getTeacher()|">
                                        <option value="" >选择教学基地</option>
                                        <option th:each="item:${teaSite}" th:value="${item.id}" th:text="${item.name}"></option>
                                    </select>
                                    <select id="teacherLevel" name="teacherLevel" class="form-control" th:onchange="|getTeacher()|">
                                        <option value="">选择教师级别</option>
                                        <option th:each="item:${teaLevel}" th:value="${item.id}" th:text="${item.name}"></option>
                                    </select>
                                    <select id="teacherDefault" name="teacherDefault" class="form-control" th:onchange="|getTeacher()|">
                                        <option value="">不限老师</option>
                                        <option value="1">常用老师</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-2">上课时间:</label>
                                <div class="col-sm-5">
                                    <input name="releaseTime" id="releaseTime" class="form-control" autocomplete="off" th:value="${#dates.format(lessonInfo.releaseTime,'yyyy-MM-dd HH:mm:ss')}"
                                           onclick="WdatePicker({minDate:'%y-%M-%d %H:%m:00',dateFmt:'yyyy-MM-dd HH:mm:00',readOnly:true,hmsMenuCfg:{H:[1,6],m:[20,3]},disabledDates:['....-..-.. 00\:..\:..','....-..-.. 01\:..\:..','....-..-.. 02\:..\:..','....-..-.. 03\:..\:..','....-..-.. 04\:..\:..','....-..-.. 05\:..\:..','....-..-.. 06\:..\:..','....-..-.. 07\:..\:..','....-..-.. 23\:..\:..'],onpicked:function(dp){$(this).val(dp.cal.getNewDateStr());getTeacher();}})">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-2">上课老师:</label>
                                <div class="col-sm-5">
                                    <select name="teacherLogin" id="teacherLogin" class="form-control selectpicker" th:title="请选择老师" data-live-search="true" data-live-search-placeholder="搜索老师" onchange="changeTeacher($(this).val())">
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-2">上课平台:</label>
                                <div class="col-sm-5">
                                    <select class="form-control" id="classWayId" name="classWayId">
                                        <option th:each="item:${classWay}" th:value="${item.id}" th:text="${item.name}" th:selected="${item.id==lessonInfo.classWayId}"></option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" id="lcrid">
                                <label class="control-label col-sm-2">更换老师原因:</label>
                                <div class="col-sm-7">
                                    <select class="form-control" id="reasonId" name="reasonId">
                                        <option value>--Please select the reason for teacher transfer--</option>
                                        <option th:each="item:${reason}" th:value="${item.id}" th:text="${item.name}"></option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <input type="hidden" name="lessonId" id="lessonId" th:value="${lessonInfo.lessonId}">
                                <input type="hidden" name="orderId" id="orderId" th:value="${lessonInfo.orderId}">
                                <input type="hidden" id="tokenString" th:value="${tokenString}">
                                <input id="recorder" th:value="${session.loginname}" type="hidden"/>
                                <input id="recordId" th:value="${session.userid}" type="hidden"/>
                                <input id="bookedUrl" th:value="${bookedUrl}" type="hidden"/>
                                
                                <div class="col-sm-11 text-center" >
                                    <button type="button" class="btn btn-default btn-md" onclick="layerClose()"> 取消 </button>&nbsp;&nbsp;&nbsp;&nbsp;
                                    <button type="button" class="btn btn-primary btn-md" th:onclick="|saveChangeInfo()|"> 保存 </button>
                                    <button type="button" class="btn btn-warning btn-md" id="addAuto" style="display: none;margin-left: 10px;" th:onclick="|addChangeAutoInfo()|"> 加入调课计划 </button>
                                    <button type="button" class="btn btn-info btn-md" id="addTemAuto" style="display: none;margin-left: 10px;" th:onclick="|addTemporaryChangeAutoInfo()|"> 加入临时老师调课计划 </button>
                                </div>
                            </div>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include/onload_js::onloadJSCustom(~{::script})">
    <script src="../../static/lesson/changeClass.js" th:src="@{/static/lesson/changeClass.js?v=15}"></script>
    <script>
        $(function () {
            getTeacher();
        });
    </script>
</div>
</body>
</html>